{% extends "base.html" %}

{% block title %}登录 - 个人记账应用{% endblock %}

{% block content %}
    <div class="d-flex justify-content-center align-items-center vh-100">
        <div class="login-container">
            <h3 class="text-center mb-4">个人记账应用 - 登录</h3>

<!--            &lt;!&ndash; 显示闪存消息 &ndash;&gt;-->
<!--            {% with messages = get_flashed_messages(with_categories=True) %}-->
<!--                {% if messages %}-->
<!--                    {% for category, message in messages %}-->
<!--                        <div class="alert alert-{{ category }} mt-2" role="alert">-->
<!--                            {{ message }}-->
<!--                        </div>-->
<!--                    {% endfor %}-->
<!--                {% endif %}-->
<!--            {% endwith %}-->

            <form action="{{ url_for('login') }}" method="post">
                <div class="mb-3">
                    <label for="username" class="form-label">用户名</label>
                    <div class="input-group">
                        <input type="text" class="form-control" id="username" name="username" required>
                    </div>
                </div>
                <div class="mb-3">
                    <label for="password" class="form-label">密码</label>
                    <div class="input-group">
                        <input type="password" class="form-control" id="password" name="password" required>
                        <!-- 忘记密码链接 -->
                        <div class="text-end mt-2">
                            <a href="{{ url_for('forgot_password') }}" class="link-secondary">忘记密码?</a>
                        </div>
                    </div>
                </div>
                <div class="form-check mb-3">
                    <input type="checkbox" class="form-check-input" id="remember" name="remember">
                    <label class="form-check-label" for="remember">记住密码</label>
                </div>
                <button type="submit" class="btn btn-primary w-100">登录</button>
            </form>
            <!-- 注册入口 -->
            <div class="text-center mt-3">
                <span>还没有账户？</span>
                <a href="{{ url_for('register') }}" class="link-primary">注册</a>
            </div>
        </div>
    </div>
{% endblock %}
